﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Exentials.Xoox.Styles
{
    public class XCellAlignment : XElementBase
    {
        private XAttributeBase<HorizontalAlignment> _horizontal;
        private XAttributeBase<VerticalAlignment> _vertical;
        private XAttributeBase<int> _textRotation;
        private XAttributeBase<bool> _wrapText;
        private XAttributeBase<int> _indent;
        private XAttributeBase<int> _relativeIndent;
        private XAttributeBase<bool> _justifyLastLine;
        private XAttributeBase<bool> _shrinkToFit;
        private XAttributeBase<int> _readingOrder;

        public XCellAlignment()
            : base("alignment")
        {
            _horizontal = new XAttributeBase<HorizontalAlignment>(this, "horizontal");
            _vertical = new XAttributeBase<VerticalAlignment>(this, "vertical");
            _textRotation = new XAttributeBase<int>(this,"textRotation");
            _wrapText = new XAttributeBase<bool>(this, "wrapText");
            _indent = new XAttributeBase<int>(this, "indent");
            _relativeIndent = new XAttributeBase<int>(this, "relativeIndent");
            _justifyLastLine = new XAttributeBase<bool>(this, "justifyLastLine");
            _shrinkToFit = new XAttributeBase<bool>(this, "shrinkToFit");
            _readingOrder = new XAttributeBase<int>(this, "readingOrder");
        }

        public HorizontalAlignment Horizontal
        {
            get { return _horizontal.Value; }
            set { _horizontal.Value = value; }
        }

        public VerticalAlignment Vertical
        {
            get { return _vertical.Value; }
            set { _vertical.Value = value; }
        }

        public int TextRotation
        {
            get { return _textRotation.Value; }
            set { _textRotation.Value = value; }
        }

        public bool WrapText
        {
            get { return _wrapText.Value; }
            set { _wrapText.Value = value; }
        }

        public int Indent
        {
            get { return _textRotation.Value; }
            set { _textRotation.Value = value; }
        }

        public int RelativeIndent
        {
            get { return _relativeIndent.Value; }
            set { _relativeIndent.Value = value; }
        }

        public bool JustifyLastLine
        {
            get { return _justifyLastLine.Value; }
            set { _justifyLastLine.Value = value; }
        }

        public int ReadingOrder
        {
            get { return _readingOrder.Value; }
            set { _readingOrder.Value = value; }
        }
    }
}
